
#add_library(target-execution-manager-library STATIC
#    ./src/config/enter_exit_timeout.cpp
#    ./src/config/execution_manifest.cpp
#    ./src/config/machine_manifest.cpp
#    ./src/config/state.cpp
#    ./src/dependency_calculator.cpp
#    ./src/exec_arguments.cpp
#    ./src/executables_handler.cpp
#    ./src/executables_parser.cpp
#    ./src/execution_manager.cpp
#    ./src/execution_ordering.cpp
#    ./src/filesystem.cpp
#    ./src/function_group.cpp
#    ./src/redirect_process_output.cpp
#    ./src/startup_configuration.cpp
#    ./src/state_change_handler.cpp
#    ./src/findprocess/em_find_process_wrapper.cpp
#)

add_library(target-execution-manager-library STATIC
    ./config/enter_exit_timeout.cpp
    ./config/execution_manifest.cpp
    ./config/machine_manifest.cpp
    ./config/state.cpp
    ./exec_arguments.cpp
    ./startup_configuration.cpp
    ./function_group.cpp
    ./filesystem.cpp
    ./executables_parser.cpp
    ./executables_handler.cpp
    ./dependency_calculator.cpp
    ./state_change_handler.cpp
    ./execution_manager.cpp
    ./redirect_process_output.cpp
)

target_include_directories(target-execution-manager-library
PUBLIC
    $<INSTALL_INTERFACE:include>
PRIVATE
    $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
    #$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
)

target_link_libraries(target-execution-manager-library
PUBLIC
    nosal::log
    nosal::core
)

add_executable(target-execution-manager
    main.cpp
)

target_include_directories(target-execution-manager
PUBLIC
    $<INSTALL_INTERFACE:include>
PRIVATE
    $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
    #$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
)

target_link_libraries(target-execution-manager
PRIVATE
    target-execution-manager-library
    nosal::log
    nosal::core
)

set_target_properties(target-execution-manager PROPERTIES
    OUTPUT_NAME execution-manager
)

install(
    TARGETS target-execution-manager
    RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
)

if(NOSAL_ENABLE_TESTS)
    set(NOSAL_CURRENT_TARGET_DIR ${CMAKE_CURRENT_LIST_DIR})
    #add_subdirectory(test)
endif()
